package com.zx.fragmentlearn.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.widget.FrameLayout;

import com.zx.fragmentlearn.BaseActivity;
import com.zx.fragmentlearn.R;
import com.zx.fragmentlearn.fragment.BlankFragment2;

/**
 * 动态调用
 */
public class LearnActivity2 extends BaseActivity {
    FrameLayout fl;
    Fragment mBlankFragment2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        hideTitle();
        setContentView(R.layout.activity_learn2);
        fl = findViewById(R.id.fl);

        FragmentManager mFragmentManager = getSupportFragmentManager();
        FragmentTransaction mFragmentTransaction = mFragmentManager.beginTransaction();
        mBlankFragment2 = new BlankFragment2();
        mFragmentTransaction.add(R.id.fl, mBlankFragment2);
        mFragmentTransaction.commit();
    }


}
